<blockquote class="layui-elem-quote">
  文章管理
</blockquote>

<div class="layui-btn-container mt15 mb15">
    <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" id="add">新增</button>
</div>

{include file="common/table" /}

<style>
  .main-right{
    width:150px;
  }
</style>

<div class="main">

  <div class="main-left">
      <table class="layui-table" style="margin:0" lay-even>
          <thead>
            <tr>
              <th>ID</th>
            </tr> 
          </thead>
          <tbody>
              {volist name='chapters_list' id='vo'}
              <tr>
                  <td>{$vo.id}</td>
              </tr>
              {/volist}
          </tbody>
      </table>
  </div>

  <div class="main-mid">
    <table class="layui-table" style="width:2000px ;margin:0" lay-even>
      <thead>
        <tr>
          <th>封面图片</th>
          <th>标题</th>
          <th>所在分类</th>
          <th>语言版本</th>
          <th>状态</th>
          <th>keywords</th>
          <th>descriptions</th>
          <th>创建时间</th>
        </tr> 
      </thead>
      <tbody>
        {volist name='chapters_list' id='vo'}
          <tr>
            <td style="width:180px"><img src="{$vo.cover}" width="90" height="60" /></td>
            <td style="font-size:12px;width:350px">{$vo.title}</td>
            <td style="font-size:12px;width:350px">{$vo.category_name}</td>
            <td style="font-size:12px;width:80px">{$vo.lang}</td>
            <td style="font-size:12px;width:80px">
              <form class="layui-form" action="">
                <input type="checkbox" name="open" lay-skin="switch" lay-filter="switchTest" title="显示|隐藏" {if condition="$vo.status eq 1"}checked{/if} >
              </form>
            </td>

            <td style="font-size:12px;width:300px">{$vo.keywords}</td>
            <td style="font-size:12px;width:350px">{$vo.descriptions}</td>

            <td style="font-size:12px">{$vo.create_time}</td>
            
          </tr>
        {/volist}
      </tbody>
    </table>
    </div>


    <div class="main-right">
      <table class="layui-table" style="margin:0" lay-even >
          <thead>
            <tr>
              <th>操作</th>
            </tr> 
          </thead>
          <tbody>
            {volist name='chapters_list' id='vo'}
              <tr>
                <td>
                  <div class="layui-btn-group">
                    <a href="{:url('web.artical/edit',['id'=>$vo.id])}" type="button" class="layui-btn layui-btn-sm layui-bg-blue">编辑</a>
                  </div>
                </td>
              </tr>
            {/volist}
          </tbody>
      </table>
    </div>




<!-------------main end-------------->
  
</div>

<div id="laypage" style="text-align: center;"></div>


<script>

  layui.use(function(){
    var laypage = layui.laypage;
    // 普通用法
    laypage.render({
      elem: 'laypage',
      count: "{$total}",// 数据总数
      curr:"{$page}"
    });

    $("#laypage a").on("click",function(){
      var page = $(this).attr("data-page");
      window.location.href="{:url('web.webchapters/index')}?page="+page
    })
  });


    $(function(){

      $("#add").on("click",function(){
        window.location.href="{:url('web.artical/add')}";
      })



})



  </script>